﻿// BookInfo.cs
//

using System;

namespace BookClub.Web.DataModel {

    public partial class BookInfo {

        private const string AmazonUriFormat = "http://www.amazon.com/exec/obidos/ASIN/{0}/nikhilkothari-20";

        private bool _selected;

        public Uri AmazonUri {
            get {
                return new Uri(String.Format(AmazonUriFormat, ASIN), UriKind.Absolute);
            }
        }

        public string StatusText {
            get {
                string statusText = CheckedOut ? "Checked out" : "Available";
                if (Requests != 0) {
                    statusText = statusText + "\r\n" + Requests + " Request(s)";
                }

                return statusText;
            }
        }

        public bool IsSelected {
            get {
                return _selected;
            }
            set {
                _selected = value;
                RaisePropertyChanged("IsSelected");
            }
        }
    }
}
